-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add HTMLImageElement for Material uniform #5857
Conversation
Hey @polluxll, thanks for the PR! Can you submit a Contributor License Agreement (CLA) so we can get this reviewed and merged? |
@ggetz ,I have submited the CLA file by mail.
|
@polluxll I emailed you a question about the CLA, but haven't heard back. Please let me know if you didn't receive the email. Thanks! |
We now have a CLA from @polluxll. Thanks again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @polluxll, make sure to update CHANGES.md and add yourself to CONTRIBUTORS.md.
}else if(uniformValue instanceof HTMLImageElement){ | ||
material._loadedImages.push({ | ||
id : uniformId, | ||
image : uniformValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this block is a duplicate of the HTMLCanvasElement
case, can we just add and additional or for HTMLImageElement
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@polluxll Please address this comment when you have a minute. Thanks!
Source/Scene/Material.js
Outdated
@@ -941,7 +946,7 @@ define([ | |||
uniformType = 'float'; | |||
} else if (type === 'boolean') { | |||
uniformType = 'bool'; | |||
} else if (type === 'string' || uniformValue instanceof HTMLCanvasElement) { | |||
} else if (type === 'string' || uniformValue instanceof HTMLCanvasElement||uniformValue instanceof HTMLImageElement) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust formatting here to be consistent with spacing.
In order to make an animation by many images,we must know every image status in the process,so I change the timeline to the next time after the current image loaded.
material.uniforms.image = loadedImage;